<%-- 
    Document   : billmaking-ver02
    Created on : 22-Jul-2013, 10:31:14
    Author     : Minh Quyen
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen"/>
        <title>Bill Information Page</title>
        <link rel="shortcut icon" href="./images2/logo.jpg">

        <script>
            function validateString(value) {
                if (value.value.length == 0) {
                    alert('Username is required!');
                    return false;
                }
                return true;
            }
        </script>
    </head>
    <body style="background-image: url('images2/staff.jpg')">
        <div align="right">
            <a href="Controller?btAction=logout" class="">[Log out]</a>
        </div>
        <div align="center">
            <h1 class="text-success alert-success"><font face="Algerian">Bill Information</font></h1>
        </div>
        <hr>
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span2">
                    <jsp:include page="staffnavbar.jsp" />
                </div>
                <div class="span10" align="center">
                    <form action="Staff" method="POST">
                        <table>
                            <td>
                                <table>
                                    <tr>
                                        <td colspan="2"><h2 align="center" class="text-warning"><font face="Algerian">CUSTOMER INFORMATION</font></h2></td>
                                    </tr>
                                    <tr>
                                        <td align="right">Username</td>
                                        <td align="left">
                                            <input type="text" name="txtUsername" onblur="validateString(this);"
                                                   value="<c:if test="${not empty CUS}">${CUS.username}</c:if>" />
                                        </td>
                                        <td>
                                            <button type="submit" class="btn btn-inverse" name="btAction" value="CheckCus">Check</button>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">Full name:</td>
                                        <td align="left">
                                            <input type="text" value="<c:if test="${not empty CUS}">${CUS.account.fullname}</c:if>"
                                                   readonly="readonly" /></td>
                                    </tr>
                                    <tr>
                                        <td align="right">Card Id:</td>
                                        <td align="left">
                                            <input type="text" name="txtCardId" value="<c:if test="${not empty CUS}">${CUS.cardId}</c:if>"
                                                   readonly="readonly" /> </td>
                                    </tr>
                                    <tr>
                                        <td></td>
                                        <td>
                                            <c:if test="${not empty CUS}">
                                                <c:if test="${CUS.isBlock}">
                                                    <font color="red">This card was blocked.</font>
                                                </c:if>
                                            </c:if>
                                        </td>
                                    </tr>
                                    <tr>
                                        <c:if test="${not empty CUS}">
                                            <c:if test="${not CUS.isBlock}">
                                                <td></td>
                                                <td><button type="submit" class="btn btn-inverse" name="btAction" value="getBill">Get bill</button></td>
                                            </c:if>
                                        </c:if>
                                    </tr>
                                </table>
                            </td>
                            <td width="20%"></td>
                            <c:if test="${not empty CUS}">
                                <c:if test="${not CUS.isBlock}">
                                    <td><!--product-->
                                        <table>
                                            <tr>
                                                <td colspan="2"><h2 align="center" class="text-warning"><font face="Algerian">PRODUCT INFORMATION</font></h2></td>
                                            </tr>
                                            <tr>
                                                <td align="right">Product:</td>
                                                <td align="left">
                                                    <select name="ddlProId">
                                                        <c:forEach var="pro" items="${PRODUCT}">
                                                            <option value="${pro.productId}">${pro.productId} - ${pro.productName}</option>
                                                        </c:forEach>
                                                    </select>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="right">Quantity:</td>
                                                <td align="left"><input type="text" name="txtQuantity" value="${param.txtQuantity}" />
                                                    <c:if test="${not empty MESS}"><br/><font color="red">${MESS}</font></c:if>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td align="right"></td>
                                                <td align="left">
                                                    <input type="submit" class="btn btn-inverse" value="+" name="btAction" />
                                            </tr>
                                        </table>
                                    </td>
                                </c:if>
                            </c:if>
                        </table>
                    </form>
                </div>
            </div>
        </div>
    </body>
</html>
